## Code to read in and clean up cumulative ANES
## data for analyses
##
## September 2022


# Initial settings --------------------------------------------------------
pacman::p_load(tidyverse, anesr)


# Read in data --------------------------------------------------

# from anes
anes_filename <- "jen_data/anes_timeseries_cdf_csv_20211118.csv"
df <- read_csv(anes_filename)


# alan's cleaned cumulative + added info from
# specific year anes data
# df_alan <- read_rds("review-2/clean-anes-cumulative")
# table(df_alan$year, df_alan$race_of_interviewer)
# table(df_alan$year, df_alan$r_race)
# 
filenames <- paste0("jen_data/anesr/", list.files("jen_data/anesr/"))
for (file in filenames){load(file)}

# Checking information ----------------------------------------------------


table(df$VCF0004, df$VCF0017) # unique modes of interview, 0 is ALL personal
unique(df$VCF0004) # years

# interviewer race
unique(df$VCF0071a) # pre, 2 is black, apparently not available after 2002? use c and d
unique(df$VCF0071b) # post
unique(df$VCF0071c) # pre, 1 is white 
unique(df$VCF0071d) #post


df$VCF0105a %>% unique()
# year, race of interviewer (2)
table(df$VCF0004, df$VCF0071a)


### CHECKING IDEOLOGY INFORMATION ###

# year, race --> 1 is white, 2 is black, 3 is other
table(df$VCF0004, df$VCF0106)

# year, ideology
table(df$VCF0004, df$VCF0803)

# year, rparty ques
table(df$VCF0004, df$VCF0504)

# year, dparty ques
table(df$VCF0004, df$VCF0503)

# year, dem pres candidate ques
table(df$VCF0004, df$VCF9088)

# year, rep pres candidate ques
table(df$VCF0004, df$VCF9096)

# year, (yes reps are more conservative) answer
table(df$VCF0004, df$VCF0502a)

df %>% 
  filter(VCF0004 == 2012) %>% 
  group_by(VCF0106, VCF0017) %>% 
  tally()



# Clean cumulative data ---------------------------------------------------

# clean up the cumulative data from years 1972 to 2020 
# a lot of code based off of alan (thanks!)
df_7220 <- df %>% 
  rename( # some feeling thermometer vars
    ft_blacks = VCF0206, ft_whites = VCF0207,
    ft_big_business = VCF0209, ft_unions  = VCF0210,
    ft_hispanics = VCF0217, ft_middle_class = VCF0219,
    ft_gays = VCF0232,
    # misc survey vars
    year = VCF0004,
    weight = VCF0009z,
    r_id = VCF0006) %>% 
  mutate(
    across(starts_with("ft"), ~.x/100),
    # interviewer vars
    race_of_interviewer = factor(case_when(
      VCF0071a == 2 ~ "Black",
      VCF0071a %in% c(1, 3:7) ~ "Non-Black"
    ), 
    levels = c("Non-Black",
               "Black")),
    gender_of_interviewer = factor(case_when(
      VCF0070a == 1 ~ "Man",
      VCF0070a == 2 ~ "Woman"
    ),
    levels = c("Man",
               "Woman")),
    
    # respondent demographic vars
    r_race = factor(case_when(
      VCF0106 == 1 ~ "White",
      VCF0106 == 2 ~ "Black",
      VCF0106 == 3 ~ "Other"
    ),
    levels = c("White",
               "Black",
               "Other")),
    r_income = (case_when(
      VCF0114 %in% c(1:5) ~ as.numeric(VCF0114)
    ) - 1)/4,
    r_education = (case_when(
      VCF0140a %in% c(1:7) ~ as.numeric(VCF0140a)
    ) - 1)/6,
    r_south = case_when(
      VCF0113 == 1 ~ "South",
      VCF0113 == 2 ~ "Nonsouth"
    ),
    r_age = (case_when(
      as.numeric(VCF0101) %in% c(18:99) ~ as.numeric(VCF0101)
    ) - 18)/(99-18),
    r_gender = case_when(
      VCF0104 == 1 ~ "Man",
      VCF0104 == 2 ~ "Woman"
    ),
    
    # party and ideology of respodnent
    r_party = (case_when(
      as.numeric(VCF0301) %in% c(1:7) ~ as.numeric(VCF0301)
    ) - 1)/6,
    r_party_dichotomized = case_when(
      VCF0301 <= 3 ~ 1,
      VCF0301 > 3 & VCF0301 <= 7 ~ 0,
    ),
    r_ideology = (case_when(
      as.numeric(VCF0803) %in% c(1:7) ~ as.numeric(VCF0803),
      VCF0803 == 9 & VCF0824 == 1 ~ 3,
      VCF0803 == 9 & VCF0824 == 3 ~ 4,
      VCF0803 == 9 & VCF0824 == 5 ~ 5,
    ) - 1)/6,
    
    # 3 level party and ideology, ordered
    r_party_name = ordered(case_when(
      as.numeric(VCF0301) < 4 ~ "Democrat",
      as.numeric(VCF0301) > 4 ~ "Republican",
      as.numeric(VCF0301) == 4 ~ "Independent"
    ), c("Democrat", "Independent", "Republican")),
    r_ideology_name = ordered(case_when(
      r_ideology < .5 ~ "Liberal",
      r_ideology > .5 ~ "Conservative",
      r_ideology == .5 ~ "Moderate"
    ), c("Liberal", "Moderate", "Conservative")),
    
    # ideo awareness variable, based off of david's code
    # (edited to include moderates in party correct)
    dpty_correct = ifelse(VCF0503 %in% seq(1,4), 1, 0),
    rpty_correct = ifelse(VCF0504 %in% seq(4, 7), 1, 0),
    dpc_correct = ifelse(VCF9088 %in% seq(1,4), 1, 0),
    rpc_correct = ifelse(VCF9096 %in% seq(4,7), 1, 0),
    conspty_correct = ifelse(VCF0502a %in% 2, 1, 0),
    conspty_same_correct = ifelse(VCF0502a %in% c(2,5), 1, 0),
    conspty_correct_nomod = ifelse(VCF0502a %in% 2 , 1, NA),
    conspty_correct_nomod = ifelse(VCF0502a %in% 5 , 1, NA)) %>% 
  group_by(year) %>% 
  # check if the question was asked at all in the year (anyone scores 1?)
  mutate(across(ends_with("correct"), .names = "{col}_count",
                ~sum(.))) %>% 
  ungroup() %>% 
  mutate(across(ends_with("correct_count"),
                ~ifelse(.==0, 0, 1))) %>% 
  mutate(
    ideo_awareness = dpty_correct + rpty_correct + dpc_correct +
      rpc_correct + conspty_correct,
    ia_correct_count = dpty_correct_count + rpty_correct_count + 
      dpc_correct_count + rpc_correct_count + conspty_correct_count,
    ideo_awareness_scaled = ideo_awareness/5,
    # previous measure
    dpc_correct_nomod = ifelse(VCF9088 %in% seq(1,3), 1, 0),
    rpc_correct_nomod = ifelse(VCF9096 %in% seq(5,7), 1, 0),
    ideo_awareness_prev = dpty_correct + rpty_correct + dpc_correct_nomod +
      rpc_correct_nomod + conspty_correct,
    ideo_awareness_prev_scaled = ideo_awareness_prev/5,
    
    #religiosity
    religiosity1 = (case_when( #1964 - 1990
      VCF0850 %in% c(1:3) ~ as.numeric(VCF0850)
    ) - 3)/(-2),
    religiosity2 = (case_when( #1980 - 2016
      VCF0846 %in% c(1:2) ~ as.numeric(VCF0846)
    ) - 2)/(-1),
    religiosity3 = (case_when( #1980 - 2016
      VCF0847 == 5 ~ 0,
      VCF0847 == 1 ~ 1,
      VCF0847 == 2 ~ 2,
      VCF0847 == 3 ~ 3,
    ))/(3),
    religiosity.index = (religiosity1 + religiosity2 + religiosity3)/3,
    
    # moral traditionalism
    moral1 = (case_when(
      VCF0851 %in% c(1:5) ~ as.numeric(VCF0851)
    ) - 5)/(-4),
    moral2 = (case_when(
      VCF0852 %in% c(1:5) ~ as.numeric(VCF0852)
    ) - 1)/(4),
    moral3 = (case_when(
      VCF0853 %in% c(1:5) ~ as.numeric(VCF0853)
    ) - 5)/(-4),
    moral4 = (case_when(
      VCF0854 %in% c(1:5) ~ as.numeric(VCF0854)
    ) - 1)/(4),
    morality.index = (moral1 + moral2 + moral3 + moral4)/4,
    
    # racial resentment
    racial_resentment1 = (case_when(
      VCF9039 %in% c(1:5) ~ as.numeric(VCF9039)
    ) - 1)/4,
    racial_resentment2 = (case_when(
      VCF9040 %in% c(1:5) ~ as.numeric(VCF9040)
    ) - 5)/(-4),
    racial_resentment3 = (case_when(
      VCF9041 %in% c(1:5) ~ as.numeric(VCF9041)
    ) - 5)/(-4),
    racial_resentment4 = (case_when(
      VCF9042 %in% c(1:5) ~ as.numeric(VCF9042)
    ) - 1)/4,
    
    # policy (econ and social) indicies
    # econ
    policy_healthcare = (case_when(
      VCF0806 %in% c(1:7) ~ as.numeric(VCF0806)
    ) - 1)/6,
    policy_job_guar = (case_when(
      VCF0809 %in% c(1:7) ~ as.numeric(VCF0809)
    ) - 1)/6,
    policy_gov_spending = (case_when(
      VCF0839 %in% c(1:7) ~ as.numeric(VCF0839)
    ) - 7)/(-6),
    # soc
    policy_abortion = (case_when(
      VCF0838 %in% c(1:4) ~ as.numeric(VCF0838)
    ) - 4)/(-3),
    policy_immigration = (case_when(
      VCF0879 %in% c(1:5) ~ as.numeric(VCF0879)
    ) - 1)/4,
    policy_affirmative_action = case_when(
      VCF0867 == 1 & VCF0867a == 1 ~ 0,
      VCF0867 == 1 & VCF0867a == 2 ~ 1,
      VCF0867 == 1 & VCF0867a == 7 ~ 2,
      VCF0867 == 5 & VCF0867a == 7 ~ 3,
      VCF0867 == 5 & VCF0867a == 4 ~ 4,
      VCF0867 == 5 & VCF0867a == 5 ~ 5,
    )/5,
    econ_policy.index = (policy_healthcare + policy_job_guar + policy_gov_spending)/3,
    social_policy.index = (policy_abortion + policy_immigration + policy_affirmative_action)/3,
    
    #some of the racial consciousness vars
    polar_power.black = case_when(
      VCF9274 == 1 ~ 0,
      VCF9274 == 2 ~ .5,
      VCF9274 == 3 ~ 1,
      VCF9275 == 1 ~ 0,
      VCF9275 == 2 ~ .5,
      VCF9275 == 3 ~ 1,
    ),
    polar_affect = (ft_blacks - ft_whites + 1)/2,
    status_blame = (-1*(racial_resentment4 - 1) + -1*(racial_resentment3 - 1))/2,
  ) %>% 
  
  # how often does respondent follow info about politics and govt
  mutate(politics_attention = ifelse(VCF9259 %in% seq(1,5), 6-VCF9259, NA),
         
         # office rec smaller index (3pt)
         ofcrec_speaker_correct = case_when(
           VCF9260 == 1 ~ 1, 
           VCF9260 == 2 ~ 0),
         ofcrec_vp_correct = case_when(
           VCF9261 == 1 ~ 1, 
           VCF9261 == 2 ~ 0),
         ofcrec_cj_correct = case_when(
           VCF9262 == 1 ~ 1, 
           VCF9262 == 2 ~ 0),
         ofcrec.index2 = (ofcrec_speaker_correct + 
                            ofcrec_vp_correct +
                            ofcrec_cj_correct)/3
  ) %>% 
  # filter years 1972 onwards and personal only
  filter(year >= 1972, VCF0017 == 0)  %>% 
  # ) %>%  mutate(ideo_awareness_prev_scaled = ifelse(VCF0017 != 0, 
  #        NA, ideo_awareness_prev_scaled)) %>% 
  select(year, weight, ends_with("of_interviewer"), starts_with("r_"),  
         ends_with("correct"), starts_with("racial_resentment"), 
         starts_with("ideo_awareness"), starts_with("ft"), 
         starts_with("religiosity"),  starts_with("moral"), 
         starts_with("polar"), status_blame, ends_with("index"),
         starts_with("policy"), politics_attention, starts_with("ofcrec"))


# Clean individual years --------------------------------------------------

## 2004 anes
anes_2004 <- timeseries_2004 %>%
  mutate(
    r_id = V040001,
    year = 2004,
    # variables for racial consciousness 
    identity = case_when(
      V045177 == 5 ~ 0,
      V045177 == 1 & V045177a == 5 ~ 1/3,
      V045177 == 1 & V045177a == 3 ~ 2/3,
      V045177 == 1 & V045177a == 1 ~ 1,
    ),
    polar_power.white = NA, 
    
    race_of_interviewer = NA,
    
    # media var
    media.internet = NA,
    media.tv = NA,
    media.newspaper = NA,
    media.radio = NA,
    media.any = NA,
    
    days.media.internet = NA,
    days.media.tv =  ifelse(V043014 >= 0 &
                              V043014<=7,
                            V043014, NA)/7,
    days.media.newspaper = NA,
    days.media.radio = NA,
    days.media.any = NA,
    
    # office rec
    ofcrec_pmuk_correct = NA,
    ofcrec.index = NA,
  ) %>%
  select( 
    r_id,
    year,
    race_of_interviewer,
    identity,
    polar_power.white,
    media.internet,
    media.tv,
    media.newspaper,
    media.radio,
    media.any,
    ofcrec_pmuk_correct,
    ofcrec.index,
    starts_with("days"))

# 2008 anes
anes_2008 <- timeseries_2008 %>%
  mutate(
    r_id = V080001,
    year = 2008,
    race_of_interviewer = factor(case_when(
      V082254 == 1 ~ "Non-Black",
      V082254 == 2 ~ "Black",
      V082254 == 3 ~ "Non-Black"
    ),
    levels = c("Non-Black",
               "Black")),
    
    # variables for racial consciousness
    identity = case_when(#post election
      V085133 == 5 ~ 0,
      V085133 == 1 & V085133a == 5 ~ 1/3,
      V085133 == 1 & V085133a == 3 ~ 2/3,
      V085133 == 1 & V085133a == 1 ~ 1,
    ),
    polar_power.white = NA,
    
    # media news var
    media.watch_tv = case_when(
      V083024 == 0 ~ 0,
      V083024b == 1 ~ 5,
      V083024b == 2 ~ 4,
      V083024b == 3 ~ 3,
      V083024b == 4 ~ 2,
      V083024b == 5 ~ 1,
    )/5,
    media.internet = case_when(
      V083023 == 0 ~ 0,
      V083023b == 1 ~ 5,
      V083023b == 2 ~ 4,
      V083023b == 3 ~ 3,
      V083023b == 4 ~ 2,
      V083023b == 5 ~ 1,
    )/5,
    media.tv = case_when(
      V083024 == 0 ~ 0,
      V083024b == 1 ~ 5,
      V083024b == 2 ~ 4,
      V083024b == 3 ~ 3,
      V083024b == 4 ~ 2,
      V083024b == 5 ~ 1,
    )/5,
    media.newspaper = case_when(
      V083025 == 0 ~ 0, 
      V083025b == 1 ~ 5,
      V083025b == 2 ~ 4,
      V083025b == 3 ~ 3,
      V083025b == 4 ~ 2,
      V083025b == 5 ~ 1,
    )/5,
    media.radio = case_when(
      V083026 == 0 ~ 0,
      V083026b == 1 ~ 5,
      V083026b == 2 ~ 4,
      V083026b == 3 ~ 3,
      V083026b == 4 ~ 2,
      V083026b == 5 ~ 1,
    )/5,
    media.any = NA,
    
    days.media.internet = ifelse(V083023 >= 0 &
                                   V083023<=7,
                                 V083023, NA)/7,
    days.media.tv = ifelse(V083024 >= 0 &
                             V083024<=7,
                           V083024, NA)/7,
    days.media.newspaper = ifelse(V083025 >= 0 &
                                    V083025 <=7,
                                  V083025, NA)/7,
    days.media.radio  = ifelse(V083026 >= 0 &
                                 V083026 <=7,
                               V083026, NA)/7,
    days.media.any = NA,
    
    
    # office rec,
    ofcrec_pmuk_correct = NA,
    ofcrec.index = NA,
  ) %>%
  select(
    r_id,
    year,
    race_of_interviewer,
    identity,
    polar_power.white,
    media.internet,
    media.tv,
    media.newspaper,
    media.radio,
    media.any,
    ofcrec_pmuk_correct,
    ofcrec.index,
    starts_with("days")
  ) 

# 2012 anes
anes_2012 <- timeseries_2012 %>%
  mutate(
    r_id = caseid,
    year = 2012,
    race_of_interviewer = factor(case_when(
      iwrdesc_pre_race_black == 0 ~ "Non-Black",
      iwrdesc_pre_race_black == 1 ~ "Black"
    ),
    levels = c("Non-Black",
               "Black")),
    
    # variables for racial consciousness
    identity = case_when(
      link_black == 2 ~ 0,
      link_black == 1 & link_blackamt == 3 ~ 1/3,
      link_black == 1 & link_blackamt == 2 ~ 2/3,
      link_black == 1 & link_blackamt == 1 ~ 1
    ),
    polar_power.white = case_when(
      racecasi_infwhite == 1 ~ 1,
      racecasi_infwhite == 2 ~ .5,
      racecasi_infwhite == 3 ~ 0,
    ),
    
    # media news var
    media.internet = case_when(
      prmedia_wkinews == 0 ~ 0,
      prmedia_atinews == 1 ~ 5,
      prmedia_atinews == 2 ~ 4,
      prmedia_atinews == 3 ~ 3,
      prmedia_atinews == 4 ~ 2,
      prmedia_atinews == 5 ~ 1,
    )/5,
    media.tv = case_when(
      prmedia_wktvnws == 0 ~ 0,
      prmedia_attvnews == 1 ~ 5,
      prmedia_attvnews == 2 ~ 4,
      prmedia_attvnews == 3 ~ 3,
      prmedia_attvnews == 4 ~ 2,
      prmedia_attvnews == 5 ~ 1,
    )/5,
    media.newspaper = case_when(
      prmedia_wkpaprnws == 0 ~ 0,
      prmedia_atpprnews == 1 ~ 5,
      prmedia_atpprnews == 2 ~ 4,
      prmedia_atpprnews == 3 ~ 3,
      prmedia_atpprnews == 4 ~ 2,
      prmedia_atpprnews == 5 ~ 1,
    )/5,
    media.radio = case_when(
      prmedia_wkrdnws == 0 ~ 0, 
      prmedia_atrdnews == 1 ~ 5,
      prmedia_atrdnews == 2 ~ 4,
      prmedia_atrdnews == 3 ~ 3,
      prmedia_atrdnews == 4 ~ 2,
      prmedia_atrdnews == 5 ~ 1,
    )/5,
    media.any = NA,
    
    days.media.internet = ifelse(prmedia_wkinews >= 0 &
                                   prmedia_wkinews<=7,
                                 prmedia_wkinews, NA)/7,
    days.media.tv = ifelse(prmedia_wktvnws >= 0 &
                             prmedia_wktvnws<=7,
                           prmedia_wktvnws, NA)/7,
    days.media.newspaper = ifelse(prmedia_wkpaprnws >= 0 &
                                    prmedia_wkpaprnws<=7,
                                  prmedia_wkinews, NA)/7,
    days.media.radio = ifelse(prmedia_wkrdnws >= 0 &
                                prmedia_wkrdnws<=7,
                              prmedia_wkrdnws, NA)/7,
    days.media.any = NA,
    
    # OFFICE RECOGNITION
    ofcrec_pmuk_correct = case_when(
      ofcrec_pmuk_correct == 1 ~ 1,
      ofcrec_pmuk_correct == 0 ~ 0
    ),
    ofcrec.index = (ofcrec_speaker_correct + 
                      ofcrec_vp_correct +
                      ofcrec_pmuk_correct +
                      ofcrec_cj_correct)/4
  ) %>%
  select(
    r_id,
    year,
    race_of_interviewer,
    identity,
    polar_power.white,
    media.internet,
    media.tv,
    media.newspaper,
    media.radio,
    media.any,
    ofcrec_pmuk_correct,
    ofcrec.index,
    starts_with("days")) 


# 2016 anes
anes_2016 <- timeseries_2016 %>%
  mutate(
    r_id = V160001,
    year = 2016,
    race_of_interviewer = factor(case_when(
      V168263 == 2 ~ "Non-Black",
      V168263 == 1 ~ "Black"
    ),
    levels = c("Non-Black",
               "Black")),
    
    # variables for racial consciousness
    identity = case_when( # post election
      V162225 == 4 ~ 0,
      V162225 == 3 ~ 1/3,
      V162225 == 2 ~ 2/3,
      V162225 == 1 ~ 1
    ),
    polar_power.white = case_when( # same
      V162322 == 1 ~ 1,
      V162322 == 2 ~ .5,
      V162322 == 3 ~ 0,
    ),
    
    # media var
    media.internet = NA,
    media.tv = NA,
    media.newspaper = NA,
    media.radio = NA,
    media.any = case_when(
      V161008 == 0 ~ 0, 
      V161009 == 1 ~ 5,
      V161009 == 2 ~ 4,
      V161009 == 3 ~ 3,
      V161009 == 4 ~ 2,
      V161009 == 5 ~ 1,
    )/5,
    
    
    days.media.internet = NA,
    days.media.tv =  NA,
    days.media.newspaper = NA,
    days.media.radio = NA,
    days.media.any = ifelse(V161008 >= 0 &
                              V161008<=7,
                            V161008, NA)/7,
    
    # office rec
    ofcrec_pmuk_correct = NA,
    ofcrec.index = NA,
  ) %>%
  select(
    r_id,
    year,
    race_of_interviewer,
    identity,
    polar_power.white,
    media.internet,
    media.tv,
    media.newspaper,
    media.radio,
    media.any,
    ofcrec_pmuk_correct,
    ofcrec.index,   
    starts_with("days")
  ) 




# Big merge and write everything out --------------------------------------

df_merged <- rbind( # bind all our years
  anes_2004,
  anes_2008,
  anes_2012,
  anes_2016) %>%
  # add in cumulative data
  left_join(
    x = df_7220,
    y = .,
    by = c("r_id", "year")
  ) %>%
  #move the race of interviewer over
  mutate(
    race_of_interviewer = case_when(
      year %in% c(1988:2002) ~ as.factor(race_of_interviewer.x),
      year %in% c(2004:2016) ~ as.factor(race_of_interviewer.y)
    ),
    
    # make var that relied on individual timeseries data
    polar_power.diff = (polar_power.black + polar_power.white)/2,
    racial_consciousness = (identity + polar_power.diff + polar_affect + status_blame)/4,
    media.index = (media.internet + media.tv + media.newspaper + media.radio)/4,
    media.index2 = pmax(media.internet, media.tv, media.any,
                        media.newspaper, media.radio, na.rm = TRUE),
    # take maximum of reported news consumption
    days.media.index = pmax(days.media.internet, 
                            days.media.tv,
                            days.media.newspaper,
                            days.media.radio,
                            days.media.any,
                            na.rm = TRUE)
  ) 


df_all <- df_merged %>% 
  group_by(year) %>% 
  # center some variables within year
  # default is center = TRUE
  mutate(r_ideology.center = as.vector(scale(r_ideology, scale = FALSE)), 
         r_party.center = as.vector(scale(r_party, scale = FALSE)),
         racial_consciousness.center =as.vector(scale(racial_consciousness, 
                                                      scale = FALSE)),
         across(ends_with("correct"), .names = "{col}.center", 
                ~as.vector(scale(., scale = FALSE))),
         across(starts_with("ideo_awareness"), .names = "{col}.center", 
                ~as.vector(scale(., scale = FALSE))),
         across(starts_with("ft"), .names = "{col}.center", 
                ~as.vector(scale(., scale = FALSE))),
         across(starts_with("policy"), .names = "{col}.center", 
                ~as.vector(scale(., scale = FALSE))),
         across(ends_with(".index"), .names = "{col}.center", 
                ~as.vector(scale(., scale = FALSE))),
         ofcrec.index2.center = as.vector(scale(ofcrec.index2, scale = FALSE))) %>% 
  ungroup() %>% 
  select(-race_of_interviewer.x, -race_of_interviewer.y) 


write_rds(df_7220, "jen_data/cleaned/df_7220")
write_rds(df_all, "jen_data/cleaned/df_all")



table(df_all$year, is.na(df_all$morality.index.center))
table(df_all$year, is.na(df_all$religiosity.index.center))
table(df_all$year, is.na(df_all$racial_consciousness.center))
table(df_all$year, is.na(df_all$race_of_interviewer))

